import request from '@/utils/request'
// import Prescription from '@/views/docter/prescription.vue'

// 取所有的药
export function fetchListAll() {
  return request({
    url: '/medicine/all',
    method: 'get'
    // params: query
  })
}

// 添加药品
export function addNewMedicine(data) {
  return request({
    url: '/medicine/create',
    method: 'post',
    data
  })
}

// 药品管理取处方
// export function fetchList(query) {
export function fetchList() {
  return request({
    url: '/prescription/all_paid',
    method: 'get'
    // params: query
  })
}

// 看处方中所有药
export function fetchListM(query) {
  return request({
    url: '/medicine_use/all',
    method: 'get',
    params: query
  })
}

// 发药
export function dispenseMedicine(data) {
  return request({
    url: '/medicine/take',
    method: 'post',
    data
  })
}

// 退药
export function refundMedicine(data) {
  return request({
    url: '/medicine/refund',
    method: 'post',
    data
  })
}
